import pymysql.cursors

config = {
    'host':'localhost',
    'port':3306,
    'user':'root',
    'password':'aa147258',
    'db':'testpw',
    'charset':'utf8',
    'cursorclass':pymysql.cursors.DictCursor
}

connection = pymysql.connect(**config)

cursor = connection.cursor()

effect_row = cursor.execute("select * from gold")

# row_1 = cursor.fetchone()
# print row_1

# row_2 = cursor.fetchmany(2)

row_3 = cursor.fetchall()
print row_3

connection.commit()

cursor.close()

connection.close()
